package com.intelligencesoft.pss.entity.binding;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.intelligencesoft.pss.entity.BasePojo;
import com.intelligencesoft.pss.entity.base.UserInfo;

/**
 * 用户账号绑定列表
 */
@Entity
@Table(name="T_USER_BINDING")
public class UserBinding extends BasePojo{
	private static final long serialVersionUID = 5539163527388026456L;
	
	private UserInfo userInfo;
	
	private BindingList bindingList;
	
	private String bindId;
	
	private String bindUserName;
	
	private String accessToken;
	
	private String code;
	
	private String  openId;
	
	private String openKey;
	
	@Id
	@Column(name = "C_ID", nullable = false, length = 32)
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	public String getId() {
		return super.getId();
	}
	
	public void setId(String id) {
		super.setId(id);
	}
	
	@Column(name="C_CREATE_DATE")
	@Temporal(value=TemporalType.TIMESTAMP)
	public Date getCreateDate() {
		return super.getCreateDate();
	}
	public void setCreateDate(Date createDate) {
		super.setCreateDate(createDate);
	}
	
	@Column(name="C_DESCRIPTION")
	public String getDescription() {
		return super.getDescription();
	}

	public void setDescription(String description) {
		super.setDescription(description);
	}
	
	@ManyToOne
	@JoinColumn(name="C_USER_ID", referencedColumnName="C_ID")
	@NotFound(action=NotFoundAction.IGNORE)
	public UserInfo getUserInfo() {
		return userInfo;
	}

	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}
	
	@ManyToOne
	@JoinColumn(name="C_BIND_LIST_ID", referencedColumnName="C_ID")
	@NotFound(action=NotFoundAction.IGNORE)
	public BindingList getBindingList() {
		return bindingList;
	}

	public void setBindingList(BindingList bindingList) {
		this.bindingList = bindingList;
	}

	@Column(name="C_BIND_ID")
	public String getBindId() {
		return bindId;
	}

	public void setBindId(String bindId) {
		this.bindId = bindId;
	}
	
	@Column(name="C_ACCESS_TOKEN")
	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	@Column(name="C_BIND_USER_NAME")
	public String getBindUserName() {
		return bindUserName;
	}

	public void setBindUserName(String bindUserName) {
		this.bindUserName = bindUserName;
	}
	
	@Column(name="C_CODE")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Column(name="C_OPEN_ID")
	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}
	
	@Column(name="C_OPEN_KEY")
	public String getOpenKey() {
		return openKey;
	}

	public void setOpenKey(String openKey) {
		this.openKey = openKey;
	}
	
	
	
}
